package net.xdclass.video.controller;

import net.xdclass.video.common.Result;
import net.xdclass.video.entity.Collect;
import net.xdclass.video.entity.Records;
import net.xdclass.video.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/apiOne/collect")
public class CollectController {
    @Autowired
    private CollectService collectService;
    @GetMapping("/save")
    public Result save(@RequestParam String username,@RequestParam String name){
        collectService.saveOne(username,name);
        return Result.success();
    }
    @PostMapping("/findAll")
    public Result recordsVideoAll(@RequestBody Collect collect){
        List<Collect> collectsList=collectService.collectVideoAll(collect.getUsername());
        return Result.success(collectsList);
    }


}
